#pragma once

#include "Enemy.h"

struct Squad{
	LinkedList<Enemy *> m_enemyList;
	void Initialize(PhysicSystem *a_physicSystem, int num, int x, int y, int dx, int dy, float scale, float rot, float speed, int dur, LPCWSTR file, LPCWSTR bulletfile){
		int t_size = num;
		for(int i = 0; i < t_size; i++){
			Enemy *t_enemy = new Enemy;
			t_enemy->initialize(file, bulletfile, a_physicSystem);
			t_enemy->setData(V2DF(x,y),V2DF(dx,dy),scale,rot,speed,dur);
			m_enemyList.Insert_ToEnd(t_enemy);
			t_enemy->m_PhysicSystem = a_physicSystem;
			t_enemy->m_PhysicSystem->Create(&t_enemy->m_PhysicObject);
			t_enemy->m_PhysicObject.m_physic_object_type = PHYSIC_OBJECT_TYPE_CIRCLE;
			t_enemy->m_PhysicObject.m_radius = 10.0f;
			m_enemyList.Get_Data(i)->update();
		}
	};

	void Update(){
		int t_size = m_enemyList.Get_Size();
		for(int i = 0; i < t_size; i++){
			m_enemyList.Get_Data(i)->update();
		}
	};
	void Render(){
		int t_size = m_enemyList.Get_Size();
		for(int i = 0; i < t_size; i++){
			m_enemyList.Get_Data(i)->render();
		}
	};
	void Release(){
		int t_size = m_enemyList.Get_Size();
		for(int i = 0; i < t_size; i++){
			m_enemyList.Get_Data(i)->release();
			m_enemyList.Get_Data(i)->m_PhysicSystem->Destroy(&m_enemyList.Get_Data(i)->m_PhysicObject);
		}
		m_enemyList.Clear();
	};
};